package com.zzxx.wechat.common.enums;

import lombok.Getter;

@Getter
public enum PriceEnum {

    ZH_PRICE("ZH", "price_ca"),
    CA_PRICE("CA", "price_ca"),
    US_PRICE("US", "price_us"),
    GB_PRICE("GB", "price_gb");

    private final String country;
    private final String code;

    PriceEnum(String country, String code) {
        this.country = country;
        this.code = code;
    }

    public static String getCodeByCountry(String country) {
        for (PriceEnum value : PriceEnum.values()) {
            if (value.getCountry().equals(country)) {
                return value.getCode();
            }
        }
        return null;
    }

}
